package com.mike.bdb.ui.provider.table;

import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.graphics.Image;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.mike.bdb.ui.SecondaryEntityTable;
import com.mike.bdb.util.DataCurrent;
import com.mike.bdb.util.ImageManager;
import com.mike.bdb.util.ReflectUtil;

public class MikeSecondaryTableLabelProvider implements ITableLabelProvider {

	private static final Logger LOG = LoggerFactory.getLogger(MikeSecondaryTableLabelProvider.class);
	
	@Override
	public Image getColumnImage(Object obj, int index) {
		if(index == 0) return ImageManager.getImage(ImageManager.ICON_BULLET_KEY);
		return null;
	}
	
	@Override
	public String getColumnText(Object obj, int index) {
		
		String curStoreClazz = DataCurrent.getInstance().curStoreClazz;
		
		return ReflectUtil.invokeGet(curStoreClazz, index, obj);
	}

	@Override
	public void addListener(ILabelProviderListener arg0) {
	}

	@Override
	public void dispose() {
	}

	@Override
	public boolean isLabelProperty(Object arg0, String arg1) {
		return false;
	}

	@Override
	public void removeListener(ILabelProviderListener arg0) {
	}

}
